package com.example.controlcarappv2;

import android.widget.Toast;

public class ControlaCarro {
	
	static String s = "";

	public synchronized void frente(BluetoothService servico) throws InterruptedException{
		s = "8";
		servico.write(s.getBytes());
		wait(Toast.LENGTH_SHORT);
	}
	
	public synchronized void atras(BluetoothService servico) throws InterruptedException{
		s = "2";
		servico.write(s.getBytes());
		wait(Toast.LENGTH_SHORT);
	}
	
	public synchronized void direita(BluetoothService servico) throws InterruptedException{
		s = "6";
		servico.write(s.getBytes());
		wait(Toast.LENGTH_SHORT);
	}
	
	public synchronized void esquerda(BluetoothService servico) throws InterruptedException{
		s = "4";
		servico.write(s.getBytes());
		wait(Toast.LENGTH_SHORT);
	}
	
	public synchronized void reto(BluetoothService servico) throws InterruptedException{
		s = "5";
		servico.write(s.getBytes());
		wait(Toast.LENGTH_SHORT);
	}
	
	public synchronized void parado(BluetoothService servico) throws InterruptedException{
		s = "1";
		servico.write(s.getBytes());
		wait(Toast.LENGTH_SHORT);
	}
}
